<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Login extends CI_Controller {	
	 function __construct()
	 {
	  	parent::__construct();
	  	$this->load->library('session');
	 }
	 function index()
	 {
	 	 $newdata = array(
                  'UserName'  => '',
                   'logged_in' => false
               );
			$this->session->set_userdata($newdata);
			$this->session->set_userdata('logged_in',false);
	 	// redirect(base_url().'login', 'refresh');
	 	$data['msg']="";
	 	$this->load->view('login',$data);
	 }
	 function errindex()
	 {
	 	$data['msg']='用户名或密码错误';
	 	$this->load->view('login',$data);
	 }
	 function exitindex()
	 {
	 	$data['msg']='';
	 	$this->session->set_userdata('logged_in',false);
	 redirect(base_url().'login', 'refresh');
	 }
}
?>